async function feed(parent, args, ctx, info) {
  const { filter, first, skip } = args;
  const where = filter
    ? { OR: [{ url_contains: filter }, { description_contains: filter }] }
    : {};
  const allLinks = await ctx.db.query.links({});
  const count = allLinks.length;

  const queriedLinkes = await ctx.db.query.links({ first, skip, where });

  // return context.db.query.links({ first, skip, where }, info);
  return {
    linkIds: queriedLinkes.map(link => link.id),
    count,
  };
}

module.exports = {
  feed,
};
